import com.itheima.dao.UserService;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TsetBeanDI {
    public ClassPathXmlApplicationContext ctx;

    @Before
    public void init() {
        ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

    }

    @Test
    public void test01() {
        UserService user = (UserService) ctx.getBean("user");
        System.out.println(user);
    }

    @Test
    public void test02() {
        UserService user = (UserService) ctx.getBean("user1");
        System.out.println(user);
    }

    @Test
    public void test03() {
        UserService user = (UserService) ctx.getBean("user2");
        System.out.println(user);
    }
    @Test
    public void test04() {
        UserService user = (UserService) ctx.getBean("user3");
        System.out.println(user);
    }
    @Test
    public void test05() {
        UserService user = (UserService) ctx.getBean("user4");
        System.out.println(user);
    }


}
